package Utils;

import android.content.Context;
import android.graphics.Color;
import android.widget.TextView;
import android.widget.Toast;

public class toastMaking {
	public static Toast errorToast(Context context, String text) {
		Toast toast = new Toast(context);
		TextView textView = new TextView(context);
		textView.setTextSize(15);
		textView.setTextColor(Color.RED);
		textView.setBackgroundColor(Color.GRAY);
		textView.setPadding(10, 10, 10, 10);
		textView.setText(text);
		toast.setView(textView);
		/*
		 * int offsetX = 0, offsetY = 0; toast.setGravity(Gravity.CENTER,
		 * offsetX, offsetY);
		 */
		toast.setDuration(Toast.LENGTH_SHORT);
		return toast;
	}

	public static Toast infoToast(Context context, String text) {
		Toast toast = new Toast(context);
		TextView textView = new TextView(context);
		textView.setTextSize(15);
		textView.setTextColor(Color.BLUE);
		textView.setBackgroundColor(Color.GRAY);
		textView.setPadding(10, 10, 10, 10);
		textView.setText(text);
		toast.setView(textView);
		/*
		 * int offsetX = 0, offsetY = 0; toast.setGravity(Gravity.CENTER,
		 * offsetX, offsetY);
		 */
		toast.setDuration(Toast.LENGTH_SHORT);
		return toast;
	}
}
